@extends('admin::layouts.master')
@section('content')
    <div class="card" id="app">
        <div class="card-header">友情链接管理</div>
        <ul role="tablist" class="nav nav-tabs">
            <li class="nav-item"><a href="/shop/friend" class="nav-link">友情链接列表</a></li>
            <li class="nav-item"><a href="#" class="nav-link active">修改友情链接</a></li>
        </ul>
        <form action="/shop/friend/{{$friend['id']}}" method="post">
            <div class="card-body card-body-contrast">
                @csrf @method('PUT')
                <div class="form-group row">
                    <label for="title" class="col-12 col-sm-3 col-form-label text-md-right">友情链接名称</label>
                    <div class="col-12 col-md-9">
                        <input id="title" name="title" type="text"
                               value="{{ $friend['title']??old('title') }}"
                               class="form-control form-control-sm form-control{{ $errors->has('title') ? ' is-invalid' : '' }}">
                        @if ($errors->has('title'))
                            <span class="invalid-feedback" role="alert">
                <strong>{{$errors->first('title')}}</strong>
            </span>
                        @endif
                    </div>
                </div>
                <div class="form-group row">
                    <label for="link" class="col-12 col-sm-3 col-form-label text-md-right">友情链接地址</label>
                    <div class="col-12 col-md-9">
                        <input id="link" name="link" type="text"
                               value="{{ $friend['link']??old('link') }}"
                               class="form-control form-control-sm form-control{{ $errors->has('link') ? ' is-invalid' : '' }}">
                        @if ($errors->has('link'))
                            <span class="invalid-feedback" role="alert">
                <strong>{{$errors->first('link')}}</strong>
            </span>
                        @endif
                    </div>
                </div>
                <div class="form-group row">
                    <label for="isshow" class="col-12 col-sm-3 col-form-label text-md-right" style="padding-top:initial;">是否显示</label>
                    <div class="col-12 col-md-9">
                        <div class="form-check form-check-inline">
                            <input class="form-check-input" type="radio"
                                   {{$friend['isshow']=='1'?'checked':''}}
                                   name="isshow" value="1"
                                   id="isshow-1">
                            <label class="form-check-label" for="isshow-1">是</label>
                        </div>            <div class="form-check form-check-inline">
                            <input class="form-check-input" type="radio"
                                   {{$friend['isshow']=='2'?'checked':''}}
                                   name="isshow" value="2"
                                   id="isshow-2">
                            <label class="form-check-label" for="isshow-2">否</label>
                        </div>
                    </div>
                </div>
            </div>
            <div class="card-footer text-muted">
                <button class="btn btn-primary offset-sm-2">保存更新</button>
            </div>
        </form>
    </div>
@endsection
